package utils;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;

public class GetHelper {
	public static String doHttpGet(String urlString) {
		try {
			URL url = new URL(urlString);
			InputStream inputStream = url.openStream();

			BufferedReader reader = new BufferedReader(new InputStreamReader(
					inputStream));								
			StringBuilder stringBuilder = new StringBuilder(1000);

			for (String s = reader.readLine(); s != null; s = reader.readLine()) {
				stringBuilder.append(s).append("\n");
			}

			reader.close();
			inputStream.close();

			return stringBuilder.toString();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}
